The present invention relates to a microcomputer including a plurality of register banks, of which any one bank is designated by means of a bank address register for processing data stored therein.
General purpose registers are widely employed for arithmetic calculation and comparing processing in the microcomputer, and thus the microcomputer must be equipped with a plurality of general purpose registers for storing therein the results of a variety of processings or data to be processed.
The microcomputer actually employed comprises a plurality of register banks, each consisting of a series of general purpose registers. Any one of the register banks is selected by means of a bank address register for each processing to be executed. In such a microcomputer, it is easy to execute a processing of data in the same register bank. For example, in case the contents in the registers A and B of the register bank 0 should be added with each other and the result should be stored in the register A or the register bank 0, the address of the register bank 0 is set in the bank address register and then an instruction for adding the content of the register A with that of the register B is executed. In case the content of the register A of the register bank 0 is to be added with that of the register B of the register bank 1 and that the result is to be stored in the register A of the register bank 0, however, the processing has to be executed by a plurality of instructions, because two different register banks cannot be accessed at the same time during the execution of one instruction. That is, in a first instruction, the bank register 1 is accessed by setting the address of the register bank 1 in the bank address register to transfer the content of the register B of the register bank 1 to a memory. With another instruction, the bank register 0 is accessed by setting the address of the register bank 0 in the bank address register to add the content of the register A of the register bank 0 with the content stored in the memory.
Such a complicated processing was conducted not only in arithmetic processing but also in the case of frequently transferred data. Namely, the processing of the data stored in different register banks has had to be accompanied with the transfer of data via memory.
Accordingly, the processing of the data stored in different register banks was complicated and required numerous programming steps. Thus, the execution time for such a processing was prolonged.